<!-- @format -->
<script setup>
	import { ref, reactive } from 'vue'
	// 字体颜色
	const colorStr = ref('red')

	// 响应式样式对象
	const styleObj = reactive({
		color: 'green',
		background: 'yellow'
	})
</script>
<template>
	<div>
		<p :style="{ color: colorStr }">Style1</p>
		<p :style="styleObj">Style2</p>
	</div>
</template>

<style scoped></style>
